package com.guigu.liuzhireng.service.impl;

import com.guigu.liuzhireng.mapper.AccountRoleMenuMapper;
import com.guigu.liuzhireng.pojo.AccountRoleMenu;
import com.guigu.liuzhireng.service.AccountRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountRoleMenuServiceImpl implements AccountRoleMenuService {

    @Autowired
    AccountRoleMenuMapper accountRoleMenuMapper;

    public List<AccountRoleMenu> QueryIndex(String account){
        List<AccountRoleMenu> list = accountRoleMenuMapper.list(0, account);

        for (AccountRoleMenu arm : list) {
            arm.setArmlist(accountRoleMenuMapper.list(arm.getMenuid(), account));
        }
        return list;
    }
}
